// 平台属性管理模块的请求文件
import request from '@/utils/request'

//1.获取一级分类数据接口  URL:  /admin/product/getCategory1  请求方式：get
export const reqCategory1List = ()=>{
    return request({url:'/admin/product/getCategory1',method:'get'})
}

//2.获取二级分类数据接口  URL:/admin/product/getCategory2/{category1Id} 请求方式：get
export const reqCategory2List = (category1Id)=>{
    return request({url:`/admin/product/getCategory2/${category1Id}`,method:'get'})
}

//3.获取三级分类数据接口  URL: /admin/product/getCategory3/{category2Id}  请求方式：get
export const reqCategory3List = (category2Id)=>{
    return request({url:`/admin/product/getCategory3/${category2Id}`,method:'get'})
}

//4.获取商品基础数据接口 URL:/admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id} 请求方式：get
export const reqAttrInfoList = (category1Id,category2Id,category3Id) =>{
    return request({url:`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,method:'get'})
}

//5.添加属性与属性值接口    URL：/admin/product/saveAttrInfo 请求方式：post
export const reqAddOrUpdateAttr = (data) =>{
    return request({url:"/admin/product/saveAttrInfo",method:'post',data})
}
/* 
{
  "attrName": "", //属性名
  "attrValueList": [  //属性名称中的属性值
    {
      "attrId": 0,  //属性值的id
      "valueName": "string"  //属性值名
    }
  ],
  "categoryId": 0,   //携带的是category3ID
  "categoryLevel": 3,
}
*/